<?php $this->load->module('mobile/index/header', $common);?>
<style>
    .ticketadult ul{max-width:210px;overflow:hidden}
    .ticketxqtitle-right{width: 32%;
        float: right;
    }
    .btn-yd{
        border: 1px solid #349cd1;
        display: inline-block;
        border-radius: 5px;
        width: 60px;
        background-color: #349cd1;
        color: #fff;
        text-align: center;
        height: 60px;
        line-height: 35px;
        margin-top:10px;
    }

    .btn-yd span{
        display: block;
        font-size: 12px;
        background-color: #fff;
        color: #349cd1;
        border-radius: 5px;
        border-top-right-radius: 0;
        border-top-left-radius: 0;
        /* height: 20px; */
        line-height: 25px;
    }



    .ticketadult .ticketxqtitle2-right{line-height:1}
</style>
<div class="wrap" >
    <div class="container">
        <div class="ticketxq">

                 <?php if($scenic['photo']):?>
                     <?php foreach($scenic['photo'] as $k=>$v):?>
                         <img class="ticketxq-image" style="width:100%" src="<?php  echo filter_img($v['url']) ;?>" onerror="this.error=null;this.src='<?php echo URLPRE;?>static/public/images/nophoto.jpg'">
                         <?php break; endforeach ;?>
                     <div class="ticketxqtag">
                        <p><?php  echo $scenic['name'] ;?></p>
                        <span>景区等级:<?php echo str_repeat('A',$scenic['level']);?></span>
                    </div>
                 <?php endif ;?>
            <div class="ticketxqtitle">
                <div class="ticketxqtitle-left">
                    <p><?php echo $scenic['name'] ;?></p>
                    <span><img src="img/sanjiao.png" data-original="img/sanjiao.png"> 已有<i><?php echo $scenic['views'] ;?></i>人浏览</span>
                </div>
                <div class="ticketxqtitle-right">
                     <a href="javascript:;" id="js-add-favourite"> <img src="img/sc.png" data-original="img/sc.png"></a>
                   <a href="tel:<?php echo $site_service_phone?>" > <img src="img/zx.png" data-original="img/zx.png" ></a>
                </div>
            </div>
            <div class="ticketxqtitle1">
                <img src="img/diming.png" data-original="img/diming.png">
                <?php echo $scenic['address']?>
            </div>
            <?php foreach($ticket as $k=>$v):?>
            <div class="ticketxqtitle2">
                <img src="img/adult.png" data-original="img/adult.png"><?php echo $v['category_name'];?>
            </div>
            <ul>
                <li>
                    <div class="ticketadult cl">
                        <div class="ticketxqtitle2-left">
                            <ul>
                                <li><p><?php echo $v['name'];?></p></li>
                                <li><small>
                                           最晚要在游玩<font class="font-orange"><?php echo !empty($ticket[0]['earlier_date']) ? "前".$ticket[0]['earlier_date']."天，" : '当天';
                                            echo !empty($ticket[0]['earlier_time']) ? $ticket[0]['earlier_time'] : '00:00';
                                            ?>
                                        </font>前下单，请尽早预订</small></li>
                                <li>
                                    <?php if($v['prices']['display_price']=='电询'):?>
                                        <span class="tc-price">暂无价格</span>
                                    <?php else: ?>
                                        <span class="tc-price">¥<?php echo $v['prices']['price'];?></span>
                                        &nbsp;&nbsp;<i>¥<?php echo $v['prices']['display_price'];?></i>
                                    <?php endif ;?>
                                </li>

                            </ul>
                        </div>
                        <?php if(!$GLOBALS['config']['mobileorderdisable']):?>
                        <div class="ticketxqtitle2-right">
                            <?php if($v['prices']['display_price']=='电询'):?>
                                <a class="btn-yd" id="callPhone" href="tel:<?php echo $site_service_phone?>">电询<span class="flag">暂无价格</span>
                                </a>
                            <?php else: ?>
                                <a class="btn-yd" href="<?php echo site_url('/mobile/scenery/order/?ticket_id='.$v['id'].'&scenery_id='.$scenic['id'].'&referer='.$_SERVER['REQUEST_URI']); ?>"> 预订<span class="flag"><?php echo $v['payment_method_name'];?></span>
                                </a>
                            <?php endif ;?>
                        </div>
                        <?php endif;?>
                    </div>
                </li>
            </ul>
<?php endforeach ;?>
        </div>
        <div class="ticketxqtitle2">
            <img src="img/jdjs.png" data-original="img/jdjs.png">&nbsp;景点介绍
        </div>
        <div class="jdjstag">
            <span><?php  echo $scenic['name'] ;?>详情</span>
        </div>
        <div class="jdjstxt">
            <?php  echo $scenic['content']?>
        </div>
    </div>

</div>

    <script type="text/javascript">
    $(function(){

        var url = '<?php echo site_url('mobile/member/add_favourite');?>';
        var id = '<?php echo $scenic['id']; ?>';
        var title = '<?php  echo $scenic['name'] ;?>';
        $('#js-add-favourite').click(function(){
            if(!(ADMINID||USERID)){
                $.dialog({
                    style:'tip',
                    width:200,
                    closeTime:1000,
                    content: '<p style="text-align: center">您还没有登录,不能收藏</p>'
                }).open();
                return false;
            }

            $.get(url+(url.indexOf("?") > -1 ? "&" : "?")+'type=2&id='+id+'&title='+title, function(data){

                if(data.status.length>0){
                    $.dialog({
                        style:'tip',
                        width:200,
                        closeTime:1000,
                        content: '<p style="text-align: center">'+data.msg+'</p>'
                    }).open();
                }

            },'json');
        });

    })

</script>
<?php $this->load->module('mobile/index/footer', $common);?>